package com.example.demo.service;

import com.example.demo.dao.UserRoleMapper;
import com.example.demo.entity.UserRole;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

@Service
public class UserRoleServiceImpl implements UserRoleService {

    @Autowired
    private UserRoleMapper userRoleMapper;


    @Override
    public int deleteByRoleId(Integer roleId) {
        Example example=new Example(UserRole.class);
        Example.Criteria criteria=example.createCriteria();
        criteria.andEqualTo("role_id",roleId);

        return userRoleMapper.deleteByExample(example);
    }
}
